package com.resifind.www.exception;

import com.resifind.www.constant.ErrorCode;

/**
 * @author 36069
 */
public class UserException extends BaseException {

    public UserException(ErrorCode errorCode) {
        super(errorCode);
    }

    public static UserException phoneNumberAlreadyRegistered() {
        return new UserException(ErrorCode.USER_REG_PHONE_NUM_AlREADY);
    }

    public static UserException phoneNumPasswordFormatError() {
        return new UserException(ErrorCode.USER_REG_PHONE_NUM_OR_PASSWORD_FORMAT);
    }

    public static UserException phoneNumberOrPasswordError() {
        return new UserException(ErrorCode.USER_LOGIN_PHONE_NUM_OR_PASSWORD_ERROR);
    }

    public static UserException phoneNumNotExist() {
        return new UserException(ErrorCode.USER_PHONE_NUM_NOT_EXIST);
    }

    public static UserException userTypeError() {
        return new UserException(ErrorCode.USER_TYPE_ERROR);
    }

    public static UserException getUserTypeError() {
        return new UserException(ErrorCode.USER_GET_TYPE_ERROR);
    }

}
